import React from 'react';
import {HashRouter, Route, Switch} from 'react-router-dom';
import Home from '../views/home';
import Test from '../views/test'
import { createBrowserHistory } from "history";


//<button onClick={() => this.props.history.push('detail')}>通过函数跳转</button>
//<Route exact path="/detail/:id" component={Detail}/>  传参
//componentDidMount() {
//     console.log(this.props.match.params);
// }
const history = createBrowserHistory();

const BasicRoute = () => (
    <HashRouter history={history} >
        <Switch>
            <Route exact path="/" component={Home}/>
            <Route exact path="/test" component={Test}/>
        </Switch>
    </HashRouter>
);


export default BasicRoute;